
class Animals{
    String name;
    int age;

    public void eat(){
        System.out.println("动物在吃东西");
    }

}

class Dog extends Animals{

    @Override
    public void eat() {
        System.out.println("小狗在吃狗粮");
    }
}

public class test {
    public static void main(String[] args) {
        Animals animals = new Animals();
        animals.eat();

        Animals animals1 = new Dog();
        animals1.eat();
    }
}
